package com.kwedding.util;

/**
 * 生成唯一ID
 * 
 * @author MickeyWork
 *
 */
public class IDGenerate {

	private static final long WORKERID = 31;// 机器id
	private static final long DATACENTERID = 31;// 数据标识id

	private static IDWorker idWorker;

	/**
	 * 生成id
	 * 
	 * @return
	 */
	public static long generate() {
		if (idWorker == null)
			idWorker = new IDWorker(WORKERID, DATACENTERID);
		return idWorker.nextId();
	}
}
